﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RussiaLibrary
{
    public class TPolygans : Class_Polygon
    {
        public override bool Init(byte[,] Bytes_TetrisByte)
        {
            State = Class_Common.GetRandomInt() % 4;
            Console.WriteLine("TPolygans State={0}", State);
            bool ret = false;
            switch(State)
            {
                case 0:// |-
                    ret = InitBase(Bytes_TetrisByte,new KeyValuePair<int,int>(0,4),new KeyValuePair<int,int>(1,4),
                                                     new KeyValuePair<int,int>(2,4),new KeyValuePair<int,int>(1,5));
                    break;
                case 1:// ↑
                    ret = InitBase(Bytes_TetrisByte,new KeyValuePair<int,int>(0,4),new KeyValuePair<int,int>(1,3),
                                                     new KeyValuePair<int,int>(1,4),new KeyValuePair<int,int>(1,5));
                    break;
                case 2:// ↓
                    ret = InitBase(Bytes_TetrisByte,new KeyValuePair<int,int>(0,3),new KeyValuePair<int,int>(0,4),
                                                     new KeyValuePair<int,int>(0,5),new KeyValuePair<int,int>(1,4));
                    break;
                case 3:// -|
                    ret = InitBase(Bytes_TetrisByte, new KeyValuePair<int, int>(0,5), new KeyValuePair<int, int>(1,5),
                                                     new KeyValuePair<int, int>(2,5), new KeyValuePair<int, int>(1,4));
                    break;
            }
            return ret;
        }
    }
    
}
